"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.DefaultSettingFormComponent = void 0;
var _vue = require("vue");
var _core = require("@vxe-ui/core");
var _form = _interopRequireDefault(require("../../form/src/form"));
var _formItem = _interopRequireDefault(require("../../form/src/form-item"));
var _switch = _interopRequireDefault(require("../../switch/src/switch"));
var _text = _interopRequireDefault(require("../../text/src/text"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const DefaultSettingFormComponent = exports.DefaultSettingFormComponent = (0, _vue.defineComponent)({
  name: 'DefaultSettingForm',
  props: {
    formData: {
      type: Object,
      default: () => ({})
    }
  },
  emits: [],
  setup(props) {
    const $xeFormDesign = (0, _vue.inject)('$xeFormDesign', null);
    if (!$xeFormDesign) {
      return () => [];
    }
    const {
      props: formDesignProps
    } = $xeFormDesign;
    return () => {
      const {
        formData
      } = props;
      return (0, _vue.h)(_form.default, {
        data: formData,
        span: 24,
        vertical: true,
        titleBold: true
      }, {
        default() {
          const {
            showPc,
            showMobile
          } = formDesignProps;
          return [(0, _vue.h)(_formItem.default, {
            title: (0, _core.getI18n)('vxe.formDesign.formName'),
            field: 'title',
            itemRender: {
              name: 'VxeInput',
              props: {
                placeholder: (0, _core.getI18n)('vxe.formDesign.defFormTitle')
              }
            }
          }), showPc && showMobile ? (0, _vue.h)(_formItem.default, {
            title: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.name')
          }, {
            default() {
              return [(0, _vue.h)('div', {
                class: 'vxe-form-design--widget-form-item-devices'
              }, [(0, _vue.h)('div', {
                class: 'vxe-form-design--widget-form-item-pc'
              }, [(0, _vue.h)(_text.default, {
                icon: (0, _core.getIcon)().FORM_DESIGN_PROPS_PC,
                content: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.pc')
              }), (0, _vue.h)(_switch.default, {
                modelValue: formData.pcVisible,
                openLabel: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.visible'),
                closeLabel: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.hidden'),
                'onUpdate:modelValue'(val) {
                  formData.pcVisible = val;
                }
              })]), (0, _vue.h)('div', {
                class: 'vxe-form-design--widget-form-item-mobile'
              }, [(0, _vue.h)(_text.default, {
                icon: (0, _core.getIcon)().FORM_DESIGN_PROPS_MOBILE,
                content: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.mobile')
              }), (0, _vue.h)(_switch.default, {
                modelValue: formData.mobileVisible,
                openLabel: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.visible'),
                closeLabel: (0, _core.getI18n)('vxe.formDesign.widgetProp.displaySetting.hidden'),
                'onUpdate:modelValue'(val) {
                  formData.mobileVisible = val;
                }
              })])])];
            }
          }) : (0, _vue.createCommentVNode)()];
        }
      });
    };
  }
});